<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../../../assert/css/font.css" th:href="@{/assert/css/font.css}"/>
    <link rel="stylesheet" href="../../../assert/css/bootstrap.min.css" th:href="@{/assert/css/bootstrap.min.css}"/>
    <link rel="stylesheet" href="../../../assert/css/plugin/chosen/chosen.css"
          th:href="@{/assert/css/plugin/chosen/chosen.css}"/>
    <link rel="stylesheet" href="../../../assert/css/bootstrap-table.css" th:href="@{/assert/css/bootstrap-table.css}"/>
    <link href="../../../assert/css/animate.min.css" rel="stylesheet" th:href="@{/assert/css/animate.min.css}">
    <link href="../../../assert/css/plugin/toastr/toastr.min.css" rel="stylesheet"
          th:href="@{/assert/css/plugin/toastr/toastr.min.css}">
    <link href="../../../assert/css/plugin/jsTree/style.min.css" rel="stylesheet"
          th:href="@{/assert/css/plugin/jsTree/style.min.css}">
    <link href="../../../assert/css/loaders.css" rel="stylesheet"
          th:href="@{/assert/css/loaders.css}">
    <link rel="stylesheet" href="../../../assert/css/jquery-ui.css" th:href="@{/assert/css/jquery-ui.css}"/>
    <link rel="stylesheet" href="../../../assert/css/index.css" th:href="@{/assert/css/index.css(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"/>
</head>
<body>
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="tools_bar">
            <div class="pull-left">
                <a href="#" class="btn btn-default active" id="btnSearch" title="隐藏查询条"><i class="fa fa-filter"></i> 隐藏</a>
                <a href="#" class="btn btn-default active" id="refresh"><i class="fa fa-refresh"></i> 刷新</a>
            </div>
        </div>
        <div class="search on">
            <div class="search_group">
                <label class="control-label">省份：</label>
                <div class="control-inline">
                    <select type="text" id="pro" value="" class="form-control search_input" data-code="pro"></select>
                </div>
            </div>
            <div class="search_group">
                <label class="control-label">质检任务名称：</label>
                <div class="control-inline">
                    <select type="text" id="taskName" value="" class="form-control search_input"></select>
                </div>
            </div>
            <div class="search_group">
                <label class="control-label">考核月份：</label>
                <div class="control-inline">
                    <input placeholder="开始日期" class="form-control layer-date search_input" id="start" autocomplete="off"> -
                    <input placeholder="结束日期" class="form-control layer-date search_input" id="end" autocomplete="off">
                </div>
            </div>
            <div class="search_group">
                <label class="control-label">坐席班组：</label>
                <div class="control-inline">
                    <select type="text" id="seatGroup" value="" class="form-control search_input" autocomplete="off"></select>

                </div>
            </div>
            <div class="search_group">
                <label class="control-label">坐席工号：</label>
                <div class="control-inline">
                    <input type="text" id="seatId" value="" class="form-control search_input" autocomplete="off">
                </div>
            </div>
            <div class="search_group">
                <label class="control-label">坐席姓名：</label>
                <div class="control-inline">
                    <input type="text" id="seatName" value="" class="form-control search_input" autocomplete="off">
                </div>
            </div>

            <div class="search_group">
                <label class="control-label">得分范围：</label>
                <div class="control-inline">
                    <input type="text" id="scoreMin" value="" class="form-control search_input" autocomplete="off">-
                    <input type="text" id="scoreMax" value="" class="form-control search_input" autocomplete="off">
                </div>
            </div>
            <div class="search_group">
                <button id="search" class="btn  btn-primary">查询</button>
                <button id="reset" class="btn  btn-default">重置</button>
                <button id="export" class="btn  btn-default">导出</button>
            </div>
        </div>
        <table id="myTable"></table>
    </div>
</div>
<form action="" id="formDetail" class="hidden" target="_blank">
    <input type="text" id="workName1" name="workName">
    <input type="text" id="seatGroup1" name="seatGroup">
    <input type="text" id="seatId1" name="seatId">
    <input type="text" id="callStartTime1" name="callStartTime">
    <input type="text" id="callEndTime1" name="callEndTime">
    <input type="text" id="ruleId1" name="ruleId">
    <input type="text" id="id1" name="id">
</form>
<form action="" id="exportForm" class="hidden" method="post">
    <input type="text" id="workNameE" name="workId">
    <input type="text" id="seatGroupE" name="seatGroup">
    <input type="text" id="seatIdE" name="seatId">
    <input type="text" id="seatNameE" name="seatName">
    <input type="text" id="callStartTimeE" name="callStartTime">
    <input type="text" id="callEndTimeE" name="callEndTime">
    <input type="text" id="callerlocE" name="callerloc">
    <input type="text" id="workScoreMinE" name="workScoreMin">
    <input type="text" id="workScoreMaxE" name="workScoreMax">
    <input type="text" id="sortNameE" name="sortName">
    <input type="text" id="sortOrderE" name="sortOrder">
</form>
<a id="basePath" th:href="@{/}"></a>
<div th:text="${workId}" id="workIdS" class="hidden"></div>
<script src="../../../assert/js/jquery.js" th:src="@{/assert/js/jquery.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/bootstrap.min.js" th:src="@{/assert/js/bootstrap.min.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/plugin/bootstrap-table/bootstrap-table.min.js"
        th:src="@{/assert/js/plugin/bootstrap-table/bootstrap-table.min.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/plugin/bootstrap-table/bootstrap-table-mobile.min.js"
        th:src="@{/assert/js/plugin/bootstrap-table/bootstrap-table-mobile.min.js}"></script>
<script src="../../../assert/js/plugin/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"
        th:src="@{/assert/js/plugin/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"></script>
<script src="../../../assert/js/plugin/toastr/toastr.min.js"
        th:src="@{/assert/js/plugin/toastr/toastr.min.js}"></script>
<script src="../../../assert/js/base.js" th:src="@{/assert/js/base.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/jquery-ui.min.js" th:src="@{/assert/js/jquery-ui.min.js}"></script>
<!--<script src="../../../assert/js/plugin/layer/laydate/laydate.js"-->
<!--        th:src="@{/assert/js/plugin/layer/laydate/laydate.js}"></script>-->
<script src="../../../assert/js/laydate/laydate.js" th:src="@{/assert/js/laydate/laydate.js}"></script>
<script src="../../../assert/js/changeTime.js" th:src="@{/assert/js/changeTime.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/plugin/jsTree/jstree.min.js"
        th:src="@{/assert/js/plugin/jsTree/jstree.min.js}"></script>
<script src="../../../assert/js/plugin/chosen/chosen.jquery.js"
        th:src="@{/assert/js/plugin/chosen/chosen.jquery.js}"></script>
<script src="../../../assert/js/contabs.min.js" th:src="@{/assert/js/contabs.min.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/common.js" th:src="@{/assert/js/common.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script>
    //项目名称
    var basePath = $("#basePath").attr("href");
    var TableInit = function () {
        var oTableInit = new Object();
        var url = basePath + "/rest/my-accessment/get-data-list";
        var height = ($(window).height() -$(".tools_bar").height()-9-$(".search").height()-40);
        //初始化Table
        oTableInit.Init = function () {
            $('#myTable').bootstrapTable({
                url: url,         //请求后台的URL（*）
                method: 'post',                      //请求方式（*）
                cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                sortable: true,                     //是否启用排序
                sortOrder: "",                   //排序方式
                sortName: "", //排序方式
                pagination: true,//是否显示分页（*）
                height:height,
                queryParams: oTableInit.queryParams,//传递参数（*）
                responseHandler: function (res) {
                    if (res.code != 0) {
                        toastrCog.error(res.msg, 2000);
                    }
                    var arr = [];
                    for (var i = 0; i < res.data.length; i++) {
                        if(res.data[i].modelRules && res.data[i].modelRules.length>0){
                            res.data[i].updateTime = res.data[i].modelRules[0].updateTime
                        }
                        arr.push(res.data[i]);
                    }
                    tools.tableData = arr;
                    return {
                        "total": res.count,//总页数
                        "rows": arr   //数据
                    };
                },
                sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                pageNumber: 1,                       //初始化加载第一页，默认第一页
                pageSize: 10,                       //每页的记录行数（*）
                pageList: [10, 25, 50, 100],        //可供选择的每页的行数（*）
                search: false,                       //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                contentType: "application/x-www-form-urlencoded",
                strictSearch: true,
                showColumns: false,                  //是否显示所有的列
                showRefresh: false,                  //是否显示刷新按钮
                minimumCountColumns: 2,             //最少允许的列数
                clickToSelect: true,                //是否启用点击选中行
                uniqueId: "no",                     //每一行的唯一标识，一般为主键列
                showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
                cardView: false,                    //是否显示详细视图
                detailView: false,
                cellStyle: {
                    css: {"background-color": "#fff"}
                },//是否显示父子表
                onDblClickRow: function (row, elem) {
                    elem.find(".J_menuItem").click();
                },
                columns: [
//                    {
//                        checkbox: true, // 显示一个勾选框
//                        align: 'center' // 居中显示
//                    },
                    {
                        align: "center",
                        halign: "center",
                        title: '序号',//标题  可不加
                        width: 60,
                        formatter: function (value, row, index) {
                            var getOptions = $("#myTable").bootstrapTable('getOptions');
                            var pagenum = getOptions.pageNumber;
                            var pagesize = getOptions.pageSize;
                            var st = (pagenum - 1) * pagesize;
                            return (st + index + 1) + "";
                        }
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'province',
                        title: '省份',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return bs.getXInY(tools.proArr, "name", "value", value);
                        }
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'workName',
                        title: '质检任务名称',
                        sortable: true,
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'monthlyAssess',
                        title: '考核月份',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return value==0?"-":value;
                        }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'cycleAssess',
                        title: '考核周期',
                        sortable: true
                    },{
                        align: "center",
                        halign: "center",
                        field: 'groupName',
                        title: '坐席班组',
                        sortable: true,
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'seatId',
                        title: '坐席工号',
                        sortable: true,
//                        formatter:function(value, row, index){
//                            return tools.getNameInId(value);
//                        }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'seatName',
                        title: '坐席姓名',
                        sortable: true,
//                        formatter:function(value, row, index){
//                            return tools.getNameInId(value);
//                        }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'workScore',
                        title: '得分',
                        sortable: true,
                        cellStyle: function (value, row, index, field) {
                            return {
                                css: {"color": " #1c46db", "font-weight": "bold"}
                            };
                        }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'audioSum',
                        title: '质检话务量',
                        sortable: true
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'updateTime',
                        title: '得分更新时间',
                        sortable: true
                    }, {
                        field: 'Button',
                        title: '操作',
                        formatter: function (value, row, index) {
                            var id = row.id;
                            var workId = row.workId;
                            var workName = row.workName;
                            var callStartTime = row.assStartDate;
                            var callEndTime = row.assEndDate;
                            var seatId = row.seatId;
                            var monthlyAssess = row.monthlyAssess;
                            if(!monthlyAssess){
                                monthlyAssess=""
                            }
                            var params = {
                                id: id,
                                workId: workId,
                                workName: workName,
                                callStartTime: callStartTime,
                                callEndTime: callEndTime,
                                seatId: seatId,
                                monthlyAssess: monthlyAssess
                            };
                            var href = basePath + "/rest/page/resultDetail?" + $.param(params);
                            return [
                                '<a href="' + href + '" class="fa fa-eye lookDetail handleBtn J_menuItem" title="查看详情" data-href="/rest/page/resultDetail" data-index="24" data-txt="质检结果"></a>'
                            ]
                        },
                        events: {
                            'click .lookDetail': function (e, value, row, index) {

                            }
                        }
                    }
                ],
                onLoadSuccess: function (data) {  //加载成功时执行
                    resize.me(1);
                    if (!data.total || data.total == 0) {
                        var src = basePath + "/assert/image/nodata.png"
                        $(".no-records-found").find("td").html('<img src="' + src + '" th:src="@{/assert/image/nodata.png}" style="width:165px;" alt="">');
                    }
                },
                onLoadError: function () {  //加载失败时执行
//                    toastr.error('加载数据失败！');
                    var src = basePath + "/assert/image/nodata.png"
                    $(".no-records-found").find("td").html('<img src="' + src + '" th:src="@{/assert/image/nodata.png}" style="width:165px;" alt="">');
                },
                formatLoadingMessage: function () {
                    return '<div class="loaded">' +
                        '<div class="loader">' +
                        '<div class="loader-inner line-scale-pulse-out">' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '</div>' +
                        '</div>' +
                        '</div>' +
                        '<div>请稍等，数据正在加载中...</div>';
                }
            });
        };
        //得到查询的参数
        oTableInit.queryParams = function (params) {
            var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                pageNum: params.offset,   //页面大小
                pageSize: params.limit,
                sortName: this.sortName,
                sortOrder: this.sortOrder,
                workId: $("#taskName").val(),
                callStartTime: tools.changeTime($("#start").val()),
                callEndTime: tools.changeTime($("#end").val()),
                seatGroup:$("#seatGroup").val(),
                seatId: $.trim($("#seatId").val()),
                seatName: $.trim($("#seatName").val()),
                callerloc: $("#pro").val(),
                workScoreMin: $.trim($("#scoreMin").val()),
                workScoreMax: $.trim($("#scoreMax").val())
            };
            return temp;
        };
        return oTableInit;
    };
    var resize = {
        init: function () {
            resize.me(1);
            $(window).resize(function () {
                resize.me();
            })
        },
        me: function (one) {
            var winW = $(window).width();
            var winH = $(window).height();
            if(one){
                $(".ibox").width(winW);
            }else{
                $(".ibox").width(winW-20);
            }
            $(".ibox").height(winH - 20);
            bs.autoTableHeight($('#myTable'),winH -$(".tools_bar").height()-9-$(".search").height())
        }
    };
    var tools = {
        tableData: [],//用来存储表格数据
        seatArr: [],//用来存储坐席班组数据
        taskArr: [],//用来存储任务数据
        proArr: [],//用来存储省份数据
        seatIdArr: [],//用来存储坐席工号数据
        seatNameArr: [],//用来存储坐席姓名数据
        init: function () {
            tools.selectProvince();
            tools.getTaskNameData($("#pro").val());
            bs.dataTimeNew("#start","#end","month");
            tools.getSeatGroup(bs.getXInY(tools.proArr, "id", "value", $("#pro").val()));
            tools.getSeatId(bs.getXInY(tools.proArr, "id", "value", $("#pro").val()), $("#seatGroup").val());
            tools.tabSearch();
            tools.search();
            tools.enterSearch();
            tools.reset();
            tools.refresh();
            tools.export();
            $("#pro").on("change", function (event, sel) {
                var code = sel.selected;
                var id = bs.getXInY(tools.proArr, "id", "value", code);
                tools.getSeatGroup(id);
                tools.getSeatId(id, $("#seatGroup").val());
                tools.getTaskNameData($("#pro").val());
            });
            $("#seatGroup").on("change", function (event, sel) {
                var id = sel.selected;
                tools.getSeatId(bs.getXInY(tools.proArr, "id", "value", $("#pro").val()), id);
            });
        },
        selectProvince: function () {
            tools.proArr = bs.getProvince();
            bs.selectDown($("#pro"), tools.proArr, "");
        },
        getSeatGroup: function (id) {
            if($("#userIdentity",parent.document).text()=="0"){
                tools.seatArr =bs.getMeSeatGroupData();
                bs.selectDown($("#seatGroup"), tools.seatArr, "");
            }else{
                tools.seatArr =bs.getSeatGroupData(id);
                bs.selectDownNoDisabled($("#seatGroup"), tools.seatArr, "");
            }

        },
        getSeatId: function (areaId, seatGroupId) {
            tools.seatAllArr=bs.getSeatData(areaId, seatGroupId,"");
            tools.seatIdArr=[];
            tools.seatNameArr=[];
            if($("#userIdentity",parent.document).text()=="0"){
                var arr=bs.getMeSeatData("");
                for(var i=0;i<arr.length;i++){
                    tools.seatIdArr.push(arr[i].account);
                    tools.seatNameArr.push(arr[i].realName);
                }
            }else{
                for(var i=0;i<tools.seatAllArr.length;i++){
                    tools.seatIdArr.push(tools.seatAllArr[i].account);
                    tools.seatNameArr.push(tools.seatAllArr[i].realName);
                }
            }
            $("#seatId").autocomplete({
                source: tools.seatIdArr
            });
            $("#seatName").autocomplete({
                source: tools.seatNameArr
            });
            if($("#userIdentity",parent.document).text()=="0"){
                if(tools.seatIdArr.length==1){
                    $("#seatId").val(tools.seatIdArr[0]).prop("disabled",true);
                    $("#seatName").val(tools.seatNameArr[0]).prop("disabled",true);
                }else{
                    $("#seatId").val("").prop("disabled",false);
                    $("#seatName").val("").prop("disabled",false);
                }
            }
        },
        getTaskNameData: function (code) {
            tools.taskArr = bs.getHasTaskNameData(code);
            bs.selectDown($("#taskName"), tools.taskArr, "");
        },
        changeTime: function (value) {
            if (value !== "") {
                var str = value.split(" ")[0];
                var year = str.split("-")[0];
                var month = str.split("-")[1];
                return year + month;
            } else {
                return "";
            }
        },
        tabSearch: function () {
            var search = $(".search");
            $("#btnSearch").on("click", function () {
                if (search.hasClass("on")) {
                    search.slideUp();
                    search.removeClass("on");
                    $("#btnSearch").html('<i class="fa fa-filter"></i> 查询').attr("title", "显示查询条");
                } else {
                    search.slideDown();
                    search.addClass("on");
                    $("#btnSearch").html('<i class="fa fa-filter"></i> 隐藏').attr("title", "隐藏查询条");
                }

            });
        },
        search: function () {
            $("#search").on("click", function () {
                var minH=$.trim($("#scoreMin").val());
                var maxH=$.trim($("#scoreMax").val());
                if(minH!=""){
                    var re =/^\d+(\.\d+)?$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/
                    if (!re.test(minH)) {
                        toastrCog.error("得分必须是大于等于0的数字！",2000);
                        return
                    }

                }
                if(maxH!=""){
                    var re =/^\d+(\.\d+)?$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/
                    if (!re.test(maxH)) {
                        toastrCog.error("得分必须是大于等于0的数字！",2000);
                        return
                    }

                }
                if(maxH>1000000000 || minH>1000000000){
                    toastrCog.error("得分不能大于1000000000！",2000);
                    return
                }
                if(minH!="" && maxH!=""){
                    if(parseFloat(minH)>parseFloat(maxH)){
                        toastrCog.error("得分最小值不得大于最大值！",2000);
                        return
                    }
                }
                tools.tableRefresh();
            })
        },
        tableRefresh: function () {
            $("#myTable").bootstrapTable('refreshOptions', {pageNumber:1});
            $("#myTable").bootstrapTable('refresh');
        },
        enterSearch: function () {
            $("body").on("keyup", function (e) {
                var code = e.charCode || e.keyCode;
                if (code == 13) {
                    //此处编写用户敲回车后的代码
                    $("#search").click();
                }
            })
        },
        reset: function () {
            $("#reset").on("click", function () {
                bs.resetSearch($(".search"));
                bs.resetTimeNew("#start","#end");
                if($("#spanId",parent.document).attr("data-procode")==""){
                    $("#pro").val("").trigger("chosen:updated");
                    tools.getSeatGroup($("#pro").val());
                    tools.getSeatId($("#pro").val(),$("#seatGroup").val());
                }
                if($("#userIdentity",parent.document).text()!="0"){
                    $("#seatGroup").val("").trigger("chosen:updated").prop("disabled",false);
                    tools.getSeatId(bs.getXInY(tools.proArr,'id','value',$("#pro").val()),$("#seatGroup").val());
                    $("#seatId").val("").prop("disabled",false);
                    $("#seatName").val("").prop("disabled",false);
                }
                tools.getTaskNameData($("#pro").val());
                tools.tableRefresh();
            })
        },
        resetSelect: function ($obj) {
            $obj.val("");
            $obj.trigger("chosen:updated");
        },
        refresh: function () {
            $("#refresh").on("click", function () {
                $("#myTable").bootstrapTable('refresh');
            })
        },
        export: function () {
            $("#export").on("click", function () {
                if (tools.tableData.length == 0) {
                    toastrCog.error("没有可导出的数据哦！");
                    return;
                }
                var url = basePath + "/rest/my-accessment/get-data-list";
                $.ajax({
                    type: "post",
                    url: url,
                    dataType: "json",
                    async: false,
                    data: {
                        pageNum: 0,  //页面大小
                        pageSize:10,
                        workId: $("#taskName").val(),
                        callStartTime: tools.changeTime($("#start").val()),
                        callEndTime: tools.changeTime($("#end").val()),
                        seatGroup:$("#seatGroup").val(),
                        seatId: $("#seatId").val().trim(),
                        seatName: $("#seatName").val().trim(),
                        callerloc: $("#pro").val(),
                        workScoreMin: $("#scoreMin").val().trim(),
                        workScoreMax: $("#scoreMax").val().trim()
                    },
                    success: function (data) {
                        if (data.code == 0) {
                            if(data.data.length>0){
                                var form = $("#exportForm");
                                var getOptions=$("#myTable").bootstrapTable('getOptions');
                                form.attr("action", basePath + "/rest/my-accessment/export-my-ass");
                                $("#workNameE").val($("#taskName").val());
                                $("#callStartTimeE").val(tools.changeTime($("#start").val()));
                                $("#callEndTimeE").val(tools.changeTime($("#end").val()));
                                $("#seatGroupE").val($("#seatGroup").val());
                                $("#seatIdE").val($("#seatId").val().trim());
                                $("#seatNameE").val($("#seatName").val().trim());
                                $("#callerlocE").val($("#pro").val());
                                $("#workScoreMinE").val($("#scoreMin").val().trim());
                                $("#workScoreMaxE").val($("#scoreMax").val().trim());
                                $("#sortNameE").val(getOptions.sortName);
                                $("#sortOrderE").val(getOptions.sortOrder);
                                form[0].submit();
                            }else{
                                toastrCog.error("没有可导出的数据哦！")
                            }
                        }
                    }
                });
            })
        },
        initSearch:function(){
           var id= $("#workIdS").html();
           if(id){
               $("#taskName").val(id).trigger("chosen:updated");
           }
        }
    };
    $(function () {
        resize.init();//页面自适应
        tools.init();//查询条
        tools.initSearch();
        var oTable = new TableInit();
        oTable.Init();//表格初始化
    })
</script>
</body>
</html>